package main

import (
	"context"
	"encoding/json"
	"fmt"
	"gitee.com/leo-xin/novel_distribution_sdk_go/yuewen"
	"gitee.com/leo-xin/novel_distribution_sdk_go/yuewen/config"
	"io"
)

func UserGetUserInfo() {

	ctx := context.Background()

	configuration := config.NewConfiguration()

	//resp, httpRes, err := yuewen.Init(configuration).UseWechat().UserGetUserInfoApi().
	//	Get(ctx).
	//	ApiSecret(ApiSecret).Email(Email).AppFlag("wxfxmgb417").OpenId("oLCYh1kgPdVUHmLO8rotJpdjmMoU").
	//	Execute()

	resp, httpRes, err := yuewen.Init(configuration).UseDuanPian().UserGetUserInfoApi().
		Get(ctx).
		ApiSecret(ApiSecret).Email(Email).AppFlag("dpfxjyhsfzzy65920").OpenId("orSiG6zr8og0xPQnp5pB57J1qBAU").
		Execute()

	s, _ := json.Marshal(resp)
	fmt.Println(string(s))

	resBytes, _ := io.ReadAll(httpRes.Body)
	fmt.Println(string(resBytes))
	fmt.Println(err)

}
